package com.zhouzj.task.dubbo.provider;

import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.context.annotation.*;

import java.io.IOException;

/**
 * @Author: zhouzhijun
 * @Date: 2021/7/20 17:27
 */
public class ProviderApplication {

    static Object lock = new Object();

    public static void main(String[] args) throws IOException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ProviderConfiguration.class);
        context.start();
        while (true) {
            synchronized (lock) {
                try {
                    lock.wait(); //等待，直到其它线程调用 lock.notify()
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    @Configuration
    @PropertySource("classpath:/dubbo.properties")
    @EnableDubbo(scanBasePackages = "com.zhouzj.task")
    static class ProviderConfiguration {
    }
}
